//测试

//当n传入0的时候，陷入死循环
int f1(unsigned n){
    int sum=1,power=1;
    for(unsigned i=0;i<=n-1;i++){
        power*=2;
        sum+=power;
    }
    return sum;
}

int f1_cmp(int n){
    int sum=1,power=1;
    for(int i=0;i<=n-1;i++){
        power*=2;
        sum+=power;
    }
    return sum; 
}

float f2(unsigned n){
    int sum=1,power=1;
    for(unsigned i=0;i<=n-1;i++){
        power*=2;
        sum+=power;
    }
    return sum;
}
#include<stdio.h>
int main(void){
    //两个死循环的判断
    unsigned test1=0;
    printf("unsigned 0 - 1 = %d \n",test1-1);
    // printf("当n等于0的时候出现死循环 %d",f1(0));
    printf("f1(23) = %d  \n",f1(23));
    printf("f2(23) = %f  \n",f2(23));
    printf("f1(24) = %d  \n",f1(24));
    printf("f2(24) = %f  \n",f2(24));
    printf("f1(31) = %d  \n",f1(31));
    return 0;
}